package com.mybd.req.three;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author: Scq
 * @time: 2021/6/510:59
 */
public class MyMapper extends Mapper<LongWritable, Text, EmployeeInformation, Text> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String[] split = value.toString().split(",");
        EmployeeInformation employeeInformation = new EmployeeInformation();
        employeeInformation.setWage(Integer.parseInt(split[split.length - 3]) + Integer.parseInt(split[split.length - 2]));
        context.write(employeeInformation, value);
    }
}
